<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>ONLYOFFICE</title>
    <link rel="icon" href="favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" type="text/css" href="css/editor.css" />
    <script type="text/javascript" language="javascript">

        var data="id=${id}";//文件id
        // var url="${hostUrl}/works/doc/getfile";//请求路径
        var url = "PdfTestServlet";


        var xhr = new XMLHttpRequest();
        xhr.onload = function () {
            var uint8Array=new Uint8Array(xhr.response);//接收数据
            window.PDFViewerApplication.open(uint8Array);
        };
        try {
            xhr.open('POST', url,true);//发送post请求
            xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');//设置请求头
            xhr.responseType = 'arraybuffer';//设置返回类型
            xhr.send(data);//发送请求
        } catch (e) {
            console.info(e);
        }



    </script>

</head>
<body>
<div class="form">


    <div id="iframeEditor"></div>
</div>
</body>
</html>
